<?php
umask(0);
$pid = pcntl_fork();
if ($pid<0){
    exit('fork error');
}else if ($pid>0){
    exit();
}

if (!posix_setsid()){
    exit('setsid error');
}

$pid = pcntl_fork();
if ($pid<0){
    exit('fork error');
}else if ($pid>0){
    exit;
}
cli_set_process_title("php master process");